/*********************************************************************
* File: modApi.h
*
* \brief Mod API implementation. 
*
*Links functions, handles client commands, initializes DLL and misc stuff.
*
* \author Instituto Superior Tecnico de Lisboa, Portugal
* \author Technical University of Lisbon, Portugal
* 
* \author Agentes Autonomos e Sistemas Multiagente
* \author Autonomous Agents and Multiagent Systems
* 
* \version	1.0
* \date		2006/2007
*********************************************************************/
#pragma once

#include "engine.h"

//=============================================================================
// Constants and defines
//=============================================================================
/** 
 For the tournament, substitute "" for the group ID. 
 For instance: #define AASM_GROUP_ID "01" 

 This leads to the following:
  a) agent directory changes to 'addons/aasmCsAgents{AASM_GROUP_ID}'
  b) agent server command prefix changes to 'aasm{AASM_GROUP_ID}'

 Furthermore, to play aasmCsAgents versions simultaneously, the DLL name must be 
 changed as follows:
  c) rename the agent DLL to 'aasmCsAgents{AASM_GROUP_ID}'
  d) don't forget to change accordingly in the 'plugins.ini' file
 **/
#define AASM_GROUP_ID ""

#define MAXSTUDIOBONES 128

// User Menus
typedef enum
{
   MENU_NONE = 0,
   MENU_WAYPOINT_ADD,
   MENU_WAYPOINT_FLAGS,
   MENU_WAYPOINT_MENU,
   MENU_WAYPOINT_MENU2,
   MENU_WAYPOINT_SETRADIUS,
   MENU_MAIN,
   MENU_TEAMSELECT,
   MENU_MINDSELECT,
   MENU_SERVERTEAMSELECT,
} usermenu_t;

typedef void (__stdcall *GIVEFNPTRSTODLL)(enginefuncs_t *, globalvars_t *);
typedef int (FAR *GETENTITYAPI)(DLL_FUNCTIONS *, int);
typedef int (FAR *GETNEWDLLFUNCTIONS)(NEW_DLL_FUNCTIONS *, int *);
typedef int (*SERVER_GETBLENDINGINTERFACE)(int, struct sv_blending_interface_s **, struct engine_studio_api_s *, float (*rotationmatrix)[3][4], float (*bonetransform)[MAXSTUDIOBONES][3][4]);
extern HINSTANCE h_Library;
typedef void (FAR *LINK_ENTITY_GAME)(entvars_t *);

C_DLLEXPORT int Server_GetBlendingInterface (int version,
   struct sv_blending_interface_s **ppinterface,
   struct engine_studio_api_s *pstudio,
   float (*rotationmatrix)[3][4],
   float (*bonetransform)[MAXSTUDIOBONES][3][4]);

extern DLL_FUNCTIONS other_gFunctionTable;

C_DLLEXPORT void WINAPI GiveFnptrsToDll(enginefuncs_t *pengfuncsFromEngine, globalvars_t *pGlobals);

//=============================================================================
// Global variables
//=============================================================================
/**  **/
extern HINSTANCE h_Library;
extern cvar_t g_cvarException;

//=============================================================================
// Function prototypes
//=============================================================================
void getServerCommandPrefix(char* prefix);
